﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Class_Entity;
using BussinessObject;

public partial class WebApplication_QuoteUs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    private void resetAll()
    {

        txtFName.Text = "";
        txtAddress.Text = "";
        txtCity.Text = "";
        txtCName.Text = "";
        txtComments.Text = "";
        txtCountry.Text = "";
        txtEmail.Text = "";
        txtPCode.Text = "";
        txtPhone.Text = "";
        txtState.Text = "";
    }
    protected void btSubmit_Click(object sender, EventArgs e)
    {
        QuoteUs qu = new QuoteUs();
        BOQuoteUs bo = new BOQuoteUs();

        qu.Address = txtAddress.Text.Trim();
        qu.City = txtCity.Text.Trim();
        qu.Comments = txtComments.Text.Trim();
        qu.CompanyName = txtCName.Text.Trim();
        qu.Country = txtCountry.Text.Trim();
        qu.EmailAddress = txtEmail.Text.Trim();
        qu.FullName = txtFName.Text.Trim();
        qu.Phone = Convert.ToInt32(txtPhone.Text.Trim());
        qu.PostalCode = txtPCode.Text.Trim();
        qu.State = txtState.Text.Trim();

        bo.Add_QuoteUs(qu);


        HttpContext.Current.Response.Write("<script type='text/javascript'>alert('" + "Submit Successfully ..." + "');</script>");
        Response.Redirect("Default.aspx");



    }
    protected void btReset_Click(object sender, EventArgs e)
    {
        resetAll();
    }
}